package com.binarysearch;

public class Solution1539 {
    public int findKthPositive(int[] arr, int k) {
        int[] hash = new int[2002];
        for (int x : arr) {
            hash[x]++;
        }
        for (int i = 1; i < 2002; i++) {
            if (hash[i] == 0) {
                k--;
                if (k == 0) return i;
            }
        }
        return -1;
    }
}
